﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BSCMFF.Core.DataAccessLayer
{
    public partial class Survey_Form
    {
        public int FilledRespondents
        {
            get
            {
                if (this.ID != 0)
                {
                    BSCEntities context = new BSCEntities();
                    List<Survey_User> su = (from sus in context.Survey_User
                                            where sus.Survey_Form_FK == this.ID && sus.Filled == true
                                            select sus).ToList();

                    return su.Count;
                }
                return 0;
            }
            //set
            //{

            //}
        }

        public String DescriptionShort 
        { 
            get
            {
                return this.Description.Substring(0, 20) + " . . .";        
            }
        }
    }
}
